<template>
<table border="1">
    <tr>
        <td>用户名</td>
        <td>
            <input type="text" placeholder="请输入用户名" v-model="Info.name">
        </td>
    </tr>
    <tr>
        <td>密码</td>
        <td>
            <input type="password"  placeholder="请输入密码" v-model="Info.pwd">
        </td>
    </tr>
    <tr>
        <td>
            手机号
        </td>
        <td>
            <input type="text" placeholder="请输入手机号" v-model="Info.poht">
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center;">
            <input type="button" value="会员注册" @click="HuiAdd" >
        </td>
    </tr>
</table>
</template>
<script setup lang="ts">
import axios from 'axios';
import {ref} from 'vue'
 const Info=ref({
    name: "",
  pwd: "",
  poht: ""
 })

const HuiAdd=()=>{
    axios.post("https://localhost:7092/api/Hui/AddHui",Info.value)
    .then(res=>{
        if(res.data>0){
            alert("会员注册成功")
        }else if(res.data==-1){
            alert("会员用户名唯一")
        }else{
            alert("会员注册失败")
        }
    })
}
</script>